<template>
  <el-main>
    <p></p>
    <el-form :inline="true" :model="formInline" class="demo-form-inline">
      <!-- <div style=""></div> -->
      <el-form-item>
        <el-input v-model="formInline.user" placeholder="请输入客户姓名" clearable />
      </el-form-item>
       <el-form-item>
        <el-input v-model="formInline.user" placeholder="请输入预交费时间" clearable />
      </el-form-item>

      <el-form-item>
        <el-button type="primary" @click="onSubmit">
          <el-icon><Search /></el-icon>查询
        </el-button>
      </el-form-item>
    </el-form>

    <el-row>
      <!-- <el-col :span="2" :offset="17">
        
      </el-col> -->
      <el-button type="primary" @click="onSubmit"
        ><el-icon><Plus /></el-icon>添加</el-button
      >
    </el-row>
    <p></p>
    <el-table :data="tableData" style="width: 80%" border>
      <el-table-column label="预交费时间" width="130px">
        <template #default="scope">
          <div style="display: flex; align-items: center">
            <el-icon><timer /></el-icon>
            <span style="margin-left: 10px">{{ scope.row.date }}</span>
          </div>
        </template>
      </el-table-column>
      <el-table-column label="用户编号" width="80px">
        <template #default="scope">
          <el-tag>{{ scope.row.id }}</el-tag>
        </template>
      </el-table-column>
      <el-table-column label="用户姓名" width="260px">
        <template #default="scope">
          <span>{{ scope.row.name }}</span>
        </template>
      </el-table-column>
      <el-table-column label="预交费用" width="120px">
        <template #default="scope">
          <span>{{ scope.row.yvjiaofeiyong }}</span>
        </template>
      </el-table-column>
      <el-table-column label="交前费用" width="80px">
        <template #default="scope">
          <span>{{ scope.row.jiaoqian }}</span>
        </template>
      </el-table-column>
      <el-table-column label="交后费用" width="80px">
        <template #default="scope">
          <span>{{ scope.row.jiaohou }}</span>
        </template>
      </el-table-column>
      <el-table-column label="支付方式" width="80px">
        <template #default="scope">
          <span>{{ scope.row.fangsi }}</span>
        </template>
      </el-table-column>
      <el-table-column fixed="right" label="操作" min-width="120">
        <template #default="scope">
          <el-button
            type="primary"
            :icon="Edit"
            size="small"
            @click="handleEdit(scope.$index, scope.row)"
          />

          <el-button
            size="small"
            type="danger"
            :icon="Delete"
            @click="handleDelete(scope.$index, scope.row)"
          >
          </el-button>
        </template>
      </el-table-column>

    </el-table>
    <p></p>
    <el-pagination background layout="prev, pager, next" :total="1000" />
  </el-main>
</template>

<script lang="ts" setup>
import { reactive } from "vue";
import { Phone, Timer } from "@element-plus/icons-vue";
import { ref } from "vue";
import { Delete, Edit, Search, Upload, Plus } from "@element-plus/icons-vue";
import { Document, Menu as IconMenu, Location, Setting } from "@element-plus/icons-vue";
const handleOpen = (key: string, keyPath: string[]) => {
  console.log(key, keyPath);
};
const handleClose = (key: string, keyPath: string[]) => {
  console.log(key, keyPath);
};
const activeIndex = ref("1");
const activeIndex2 = ref("1");
const handleSelect = (key: string, keyPath: string[]) => {
  console.log(key, keyPath);
};
interface User {
  date: string;
  id: string;
  name: string;
  yvjiaofeiyong: string;
  jiaoqian: string;
  jiaohou: string;
  fangsi: string;
}

const handleEdit = (index: number, row: User) => {
  console.log(index, row);
};
const handleDelete = (index: number, row: User) => {
  console.log(index, row);
};

const tableData: User[] = [
  {
    date: "2016-05-03",
    id: "01",
    name: "Tom",
    yvjiaofeiyong: "231",
    jiaoqian: "12",
    jiaohou: "243",
    fangsi: "微信"
  },
  {
    date: "2016-05-03",
    id: "02",
    name: "Tom",
    yvjiaofeiyong: "231",
    jiaoqian: "12",
    jiaohou: "243",
    fangsi: "微信"
  },
  {
    date: "2016-05-03",
    id: "01",
    name: "Tom",
    yvjiaofeiyong: "231",
    jiaoqian: "12",
    jiaohou: "243",
    fangsi: "微信"
  },
  {
    date: "2016-05-03",
    id: "01",
    name: "Tom",
    yvjiaofeiyong: "231",
    jiaoqian: "12",
    jiaohou: "243",
    fangsi: "微信"
  },
];
const formInline = reactive({
  user: "",
  region: "",
  date: "",
});

const onSubmit = () => {
  console.log("submit!");
};
</script>

<style>
.demo-form-inline .el-input {
  --el-input-width: 220px;
}

.demo-form-inline .el-select {
  --el-select-width: 220px;
}
</style>
